package com.liwei.services;

import com.liwei.beans.Stu;
import com.liwei.mapper.StuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

@Component
public class StuServicesImp implements StuServices{

    @Autowired
    StuMapper stuMapper;
    @Override
    public ArrayList<Stu> getAll() {
        return stuMapper.getAll();
    }

    @Override
    public Stu get(int id) {
        return stuMapper.get(id);
    }

    @Override
    public boolean add(Stu stu) {
        return stuMapper.add(stu)>0?true:false;
    }

    @Override
    public boolean del(int id) {
        return stuMapper.del(id)>0?true:false;
    }

    @Override
    public boolean edit(Stu stu) {
        return stuMapper.edit(stu)>0?true:false;
    }
}
